<template>
	<nav-header title="表单记录" class="form-history">
		<form-list v-if="formCode" :formCode="formCode"/>
		<view v-if="formCode" :class="{'-translate-y-20': no_occlusion}"
		    class="bottom-16 duration-700 fixed  right-3 transform transition z-50 ">
		    <view @click="openForm" class="bg-green-500 mb-4 last:mb-0 rounded-full justify-center items-center w-12 h-12 bg-opacity-70 flex">
				<u-icon name="edit-pen" size="1.5rem" color="#ffffff"></u-icon>
		    </view>
		</view>
	</nav-header>
</template>

<script>
	import FormList from './form-list.vue'
	import NavHeader from '@/components/nav_header.vue'
	export default {
		components: {NavHeader,FormList},
		data() {
			return {
				no_occlusion: false,
				formCode: ''
			}
		},
		onLoad(e) {
			this.formCode = e.formCode
		},
		mounted(){
			const v = this
			// v.$nextTick(function(){
			// 	window.addEventListener('scroll', (e) => {
			// 		v.no_occlusion = (e.target.scrollHeight - e.target.scrollTop) === e.target.clientHeight;
			// 	}, true)
			// })
		},
		methods:{
			openForm(){
				this.$util.myNavigateTo('/form/detail?formCode='+this.formCode)
			}
		},
		activated(){
			// 移除当前页的“子级”组件缓存
			// this.$utils.removeChildCache(this, '/form/detail')
		}
	}
</script>

<style>

</style>
